<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../../">
  <title data-ice="title">BaseType | API Document</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
  <script src="script/prettify/prettify.js"></script>
  
  
  <script src="script/manual.js"></script>
</head>
<body class="layout-container" data-ice="rootContainer">

<header>
  <a href="./">Home</a>
  
  <a href="identifiers.html">Reference</a>
  <a href="source.html">Source</a>
  
  <a data-ice="repoURL" href="https://git.oschina.net/kinuxroot/unique-model.js.git">Repository</a>
  <div class="search-box">
  <span>
    <img src="./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
</header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/session.js~Session.html">Session</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createSession">createSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-enablePersist">enablePersist</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isPersistEnabled">isPersistEnabled</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-BaseModel">BaseModel</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-Types">Types</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-model">model</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">backend</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/backend/base.js~Dao.html">Dao</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/backend/base.js~Session.html">Session</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">model</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/model/base.js~Model.html">Model</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createModel">createModel</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getModel">getModel</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">type</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~BaseType.html">BaseType</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~Double.html">Double</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~Integer.html">Integer</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~Text.html">Text</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~UObject.html">UObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-defineType">defineType</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-toUniqueModel">toUniqueModel</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-allTypes">allTypes</a></span></span></li>
</ul>
</div>
</nav>

<div class="content" data-ice="content"><div class="header-notice">
  <div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode"></code></pre></div>
  <span data-ice="access">public</span>
  <span data-ice="kind">class</span>
  
  
  
  <span data-ice="source">| <span><a href="file/lib/type/index.js.html#lineNumber18">source</a></span></span>
</div>

<div class="self-detail detail">
  <h1 data-ice="name">BaseType</h1>

  

  
  
  
  <div class="flat-list" data-ice="directSubclass"><h4>Direct Subclass:</h4><div><span><a href="class/lib/type/index.js~Double.html">Double</a></span>, <span><a href="class/lib/type/index.js~Integer.html">Integer</a></span>, <span><a href="class/lib/type/index.js~Text.html">Text</a></span>, <span><a href="class/lib/type/index.js~UObject.html">UObject</a></span></div></div>
  
  
  
  
  

  
  
  <div class="description" data-ice="description"><p>The base class of all types.</p>
</div>

  

  

  

  
</div>



<div data-ice="constructorSummary"><h2>Constructor Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Constructor</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="class/lib/type/index.js~BaseType.html#instance-constructor-constructor">constructor</a></span></span><span data-ice="signature">(name: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>The constructor of class.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>
<div data-ice="memberSummary"><h2>Member Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Members</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      <span class="kind" data-ice="kind">get</span>
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="class/lib/type/index.js~BaseType.html#instance-get-name">name</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Get the name of type.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      <span class="kind" data-ice="kind">set</span>
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="class/lib/type/index.js~BaseType.html#instance-set-name">name</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Set the name of type.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>
<div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="class/lib/type/index.js~BaseType.html#instance-method-fromValue">fromValue</a></span></span><span data-ice="signature">(value: <span>*</span>): <span>*</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Convert the JavaScript value to the standard type of the model type.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
<table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Protected Methods</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">protected</span>
      
      
      <span class="abstract" data-ice="abstract">abstract</span>
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="class/lib/type/index.js~BaseType.html#instance-method-_fromValue">_fromValue</a></span></span><span data-ice="signature">(value: <span>*</span>): <span>Any type</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Convert the JavaScript value to the standard type of the model type.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>





<div data-ice="constructorDetails"><h2 data-ice="title">Public Constructors</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-constructor-constructor">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    <span data-ice="name">constructor</span><span data-ice="signature">(name: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/type/index.js.html#lineNumber25">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>The constructor of class.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">name</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of type.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  

  
  
</div>
</div>
<div data-ice="memberDetails"><h2 data-ice="title">Public Members</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-get-name">
    <span class="access" data-ice="access">public</span>
    
    <span class="kind" data-ice="kind">get</span>
    
    
    <span data-ice="name">name</span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/type/index.js.html#lineNumber35">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Get the name of type.</p>
</div>

  

  <div data-ice="properties">
</div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-set-name">
    <span class="access" data-ice="access">public</span>
    
    <span class="kind" data-ice="kind">set</span>
    
    
    <span data-ice="name">name</span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/type/index.js.html#lineNumber45">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Set the name of type.</p>
</div>

  

  <div data-ice="properties">
</div>

  

  

  

  

  

  

  
  
</div>
</div>
<div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-fromValue">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    <span data-ice="name">fromValue</span><span data-ice="signature">(value: <span>*</span>): <span>*</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/type/index.js.html#lineNumber67">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Convert the JavaScript value to the standard type of the model type.
It will call _fromValue to complete the task.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">value</td>
      <td data-ice="type"><span>*</span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>nullable: true</li></ul></td>
      <td data-ice="description"><p>The value of data</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tr>
        <td class="return-type" data-ice="returnType"><span>*</span></td>
        <td class="return-desc" data-ice="returnDescription"><p>The value which is the standard type of model type. Return null if value is null.</p>
</td>
      </tr>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode"> let data = {
     name: &apos;test&apos;,
     password: &apos;123&apos;
 }; 

 let model = type.fromValue(data);</code></pre>
    </div>
</div>

  

  
  
</div>
<h2 data-ice="title">Protected Methods</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-_fromValue">
    <span class="access" data-ice="access">protected</span>
    
    
    <span class="abstract" data-ice="abstract">abstract</span>
    
    <span data-ice="name">_fromValue</span><span data-ice="signature">(value: <span>*</span>): <span>Any type</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/type/index.js.html#lineNumber90">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Convert the JavaScript value to the standard type of the model type.
It is called by fromValue.
You muse implement the method in your own type.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">value</td>
      <td data-ice="type"><span>*</span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>nullable: false</li></ul></td>
      <td data-ice="description"><p>The value of data</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tr>
        <td class="return-type" data-ice="returnType"><span>Any type</span></td>
        <td class="return-desc" data-ice="returnDescription"><p>The value which is the standard type of model type.</p>
</td>
      </tr>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  
  
</div>
</div>
</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.4.3)</span></a>
</footer>

<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
